1 Imports System.Data.OleDb
2 Imports CrystalDecisions.CrystalReports.Engine
3 Imports CrystalDecisions.Shared
4 Imports System.Data
5
6 Public Class frmReportbystandard
7     Private mReport As ReportDocument
8
9 #Region
"Report load"
10     Private Sub frmReportbystandard_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
11         mReport = New ReportDocument()
12
13         Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
14         Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
15
16         mReport.Load(Application.StartupPath &
"\crStandard.rpt")
17
18         For Each tbCurrent In mReport.Database.Tables
19             tliCurrent = tbCurrent.LogOnInfo
20             With tliCurrent.ConnectionInfo
21                 .ServerName = Application.StartupPath &
"\hrs.mdb"
22                 .UserID =
""
23                 .Password =
""
24                 .DatabaseName = Application.StartupPath &
"\hrs.mdb"
25             End With
26             tbCurrent.ApplyLogOnInfo(tliCurrent)
27         Next tbCurrent
28
29         crvStandard.ReportSource = mReport
30     End Sub
31 #End Region
32
33 #Region
"Form is closed"
34     Private Sub frmReportbystandard_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
35         frmMain.Show()
36         Me.Dispose()
37         Me.Close()
38     End Sub
39 #End Region
40
41 End Class


Gõ tìm kiếm nhanh...